

void UI_TextOptions::setAction(PF_ActionInterface* a, bool update) {
    if (a!=NULL && a->rtti()==LX_Define::ActionDrawText) {
        action = (WF_DrawText*)a;

        QString st;
        QString sa;
        if (update) {
            st = action->getText();
            sa = QString("%1").arg(PF_Math::rad2deg(action->getAngle()));
        } else {
            st = "";
            sa = "0.0";
        }

/*#if defined(OOPL_VERSION) && defined(Q_WS_WIN)
        QCString iso = PF_System::localeToISO( QTextCodec::locale() );
        QTextCodec *codec = QTextCodec::codecForName(iso);
        if (codec!=NULL) {
            st = codec->toUnicode(PF_FilterDXF::toNativeString(action->getText().local8Bit()));
        } else {
            st = PF_FilterDXF::toNativeString(action->getText().local8Bit());
        }
//#else*/
        teText->setText(st);
//#endif
        leAngle->setText(sa);
    } else {
        PF_DEBUG->print(PF_Debug::D_ERROR, 
			"UI_TextOptions::setAction: wrong action type");
        action = NULL;
    }

}

void UI_TextOptions::updateText() {
    if (action!=NULL) {
/*#if defined(OOPL_VERSION) && defined(Q_WS_WIN)
        QCString iso = PF_System::localeToISO( QTextCodec::locale() );
        action->setText(
            PF_FilterDXF::toNativeString( 
             QString::fromLocal8Bit( QTextCodec::codecForName( iso )->fromUnicode( teText->text() ) )
            )
        );
//#else*/
       action->setText(teText->text());
//#endif
    }
}

void UI_TextOptions::updateAngle() {
    if (action!=NULL) {
        action->setAngle(PF_Math::deg2rad(PF_Math::eval(leAngle->text())));
    }
}
